/* 
	PROJECT: scsu-csc653-chatter
	ABOUT: main applet loaded into client interface
	DATE: 09-2010
	AUTHORS: skenny214@gmail.com, jinhongli08@gmail.com, hourigan.brian@gmail.com, yaqiluo2010@gmail.com
*/

package chatter.client;

import javax.swing.JApplet;
import javax.swing.SwingUtilities;
import javax.swing.JLabel;


public class ChatterClientApplet extends JApplet {
	private static final long serialVersionUID = 6282915757541105034L;
	
	//setup a static variable to hold an instance of our applet for reference
	public static JApplet currentApplet;
	public static boolean isDebug = true;
	
	//hold our main chatter client
	public ChatterClient chatterClient; 
	
	//Called when this applet is loaded into the browser.
    public void init() {
    	//set our static placeholder variable to THIS applet 
    	ChatterClientApplet.currentApplet = this;
    	
    	//create a new instance of the chatter client
    	this.chatterClient = new ChatterClient();
    	
        //Execute a job on the event-dispatching thread; creating this applet's GUI.
        try {
            SwingUtilities.invokeAndWait(new Runnable() {
                public void run() {
                	//run this in the main swing thread, and set some nice applet text for info
                    JLabel lbl = new JLabel(" Chatter Client Applet Started...");
                    add(lbl);
                }
            });
            
        //catch if we mess up
        } catch (Exception e) {
            System.err.println("Chatter Client Applet Didn't Complete Successfully");
        }
    }
    
    
    
    
    	
    
}
